import React from 'react';
import {
  CustomerPopupSelection,
  AddressPopupSelection,
  OuSelection,
  OuPopupSelection,
  SalesmanPoPupSelection,
  ItemPopupSelection,
  OrgTreePopupSelection,
  UserPopupSelection,
  ItemBrandPopup,
  CategoryCascader,
  OmsItemPopupSelection,
  WhPopupSelection,
  SupportItemPopupSelection,
  SuppPopupSelection, //供应商,
  MgaddressSelect,
  RegionCascader, //地区级联
  DispatchBillSelection,
  OrgPopupSelection,
  PurSceneSelection, // 采购场景
  PurcOrgPopupSelection, // 采购组织
  CoopPartnerPopupSelection // 网格仓名称/库存合作伙伴
} from './components/biz/oms';

type ELFormItemType =
  | '$oms-pop-customerPopupSelection'
  | '$oms-pop-addressPopupSelection'
  | '$mg-select-ou'
  | '$mg-popupSelect-ou'
  | '$oms-pop-salesmanPoPupSelection'
  | '$mg-pop-item'
  | '$oms-org-tree'
  | '$mg-pop-user'
  | '$support-item-brand'
  | '$support-category-cascader'
  | '$oms-pop-itemPopupSelection'
  | '$mg-pop-wh'
  | '$mg-pop-item-purc'
  | '$oms-pop-supp'
  | '$mg-distSelect'
  | '$oms-distSelect'
  | '$oms-dispatchBillSelection'
  | '$oms-orgPopupSelection'
  | '$mg-select-purScene'
  | '$mg-pop-purcOrg'
  | '$mg-pop-coopPartPopupSelection';

const ElFormItem = [
  {
    type: '$oms-pop-customerPopupSelection',
    render: (props, events) => {
      return <CustomerPopupSelection {...props} />;
    }
  },
  {
    type: '$oms-pop-addressPopupSelection',
    render: (props, events) => {
      return <AddressPopupSelection {...props} />;
    }
  },
  {
    type: '$mg-select-ou',
    render: (props, events) => {
      return <OuSelection {...props} {...events} />;
    }
  },
  {
    type: '$mg-popupSelect-ou',
    render: (props, events) => {
      return <OuPopupSelection {...props} {...events} />;
    }
  },
  {
    type: '$oms-pop-salesmanPoPupSelection',
    render: (props, events) => {
      return <SalesmanPoPupSelection {...props} />;
    }
  },
  {
    type: '$mg-pop-item',
    render: (props, events) => {
      return <ItemPopupSelection {...props} {...events} />;
    }
  },
  {
    type: '$oms-org-tree',
    render: (props, events) => {
      return <OrgTreePopupSelection {...props} />;
    }
  },
  {
    type: '$mg-pop-user',
    render: (props, events) => {
      return <UserPopupSelection {...props} {...events} />;
    }
  },
  {
    type: '$support-item-brand',
    render: (props, events) => {
      return <ItemBrandPopup {...props} />;
    }
  },
  {
    type: '$support-category-cascader',
    render: (props, events) => {
      return <CategoryCascader {...props} />;
    }
  },
  {
    type: '$oms-pop-itemPopupSelection',
    render: (props, events) => {
      return <OmsItemPopupSelection {...props} />;
    }
  },
  {
    type: '$mg-pop-wh',
    render: (props, events) => {
      return <WhPopupSelection {...props} {...events} />;
    }
  },
  {
    type: '$mg-pop-item-purc',
    render: (props, events) => {
      return <SupportItemPopupSelection {...props} />;
    }
  },
  {
    type: '$oms-pop-supp',
    render: (props, events) => {
      return <SuppPopupSelection {...props} />;
    }
  },
  {
    type: '$mg-distSelect',
    render: (props, events) => {
      return <MgaddressSelect {...props} />;
    }
  },
  {
    type: '$oms-distSelect',
    render: (props, events) => {
      return <RegionCascader {...props} />;
    }
  },
  {
    type: '$oms-dispatchBillSelection', // 发货单列表弹框
    render: (props, events) => <DispatchBillSelection {...props} {...events} />
  },
  {
    type: '$oms-orgPopupSelection', // 销售组织列表弹框
    render: (props, events) => <OrgPopupSelection {...props} {...events} />
  },
  {
    type: '$mg-select-purScene', // 采购场景
    render: (props, events) => <PurSceneSelection {...props} {...events} />
  },
  {
    type: '$mg-pop-purcOrg', // 采购组织
    render: (props, events) => <PurcOrgPopupSelection {...props} {...events} />
  },
  {
    type: '$mg-pop-coopPartPopupSelection',
    render: (props, events) => {
      return <CoopPartnerPopupSelection {...props} {...events} />;
    }
  }
];
export { ElFormItem };
export type { ELFormItemType };
